home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / UTILSTEM / TAME102.LZH / TAME.DOC next >
Text File  |  1988-10-06  |  17KB  |  350 lines

  1.                                 Tame Users Guide
  2.  
  3.                                   Release 1.02
  4.  
  5.                        Copyright 1988, by David G. Thomas
  6.  
  7. Abstract
  8.  
  9. If you run in a multitasking environment such as Desqview, you may have noticed
  10. that some programs seem to slow down the whole system, even though they seem to
  11. be doing nothing except waiting for you to type something.  When I first
  12. encountered this type of program, I accepted it as part of the price that is
  13. paid for multitasking.  The Tame program proves that this is not the case.  In
  14. fact, the Tame program will significantly reduce the overhead of many programs,
  15. without hindering their performance when they really are working.  Tame is
  16. designed to work with Desqview, but should work with any DOS based multitasking
  17. environment.
  18.  
  19. Copyright
  20.  
  21. This program may be freely distributed.  If you use Tame to speed up your
  22. applications, please contribute $10 to the author.  If you send $20 or more,
  23. you will recieve the latest copy of the program, and also a printed manual.  If
  24. you have any questions or comments, I may be reached at the PowerSoft BBS,
  25. 404-928-9294.  Contributions should be mailed to the following address.
  26.  
  27. PowerSoft
  28. P.O. Box  956338
  29. Duluth, GA 30136
  30. Attn: David G. Thomas
  31.  
  32. Applications that definitely NEED Tame
  33.  
  34. The following applications will continually poll the keyboard, waiting for you
  35. to press a key.  Tame has been proven to significantly reduce the overhead on
  36. all these applications.  For each application listed here, there are probably
  37. 100 more that need Tame!
  38.  
  39. See appendix "A" for special options that may be desirable with these programs.
  40.  
  41. Agenda, by Lotus
  42. Brief, by solution Systems
  43. Kedit, by Mansfield Computing
  44. Lucid 3D, bu PCSG
  45. Lotus 123, by Lotus Development Corp.
  46. Lotus Agenda, by Lotus Development Corp.
  47. Lotus Manuscript, by Lotus Development Corp.
  48. Microsoft editor, by Microsoft
  49. Norton Commander, by Peter Norton Computing
  50. PCBOARD, by Clark Development Company, Inc.
  51. Sidetalk, by Lattice
  52. ZCOMM, by Chuck Forsberg
  53.  
  54. Finding more applications that need Tame
  55.  
  56. Any program that uses CPU cycles looking for keyboard input needs Tame.  The
  57. best way to see if a program does this is to run a simple test.  You should
  58. test all your favorite programs that you spend time entering data with.  This
  59. includes programs such as word processors, spreadsheets, editors, and DOS
  60. shells.
  61.  
  62. One way to see if a program needs tame is to use Tame to run the program, and
  63. see what happens.   You may evaluate whether or not Tame is effective by
  64. looking at statistics generated with the Tame command, or you may use one of
  65. the many standard CPU benchmarks to test its effectiveness.
  66.  
  67. To test a program with Tame, be sure you are in Desqview, and type the
  68. following command line, where command_line is the command line you normally use
  69. to run the program.  Note that if you are not in Desqview, you must also use
  70. the -K or -I option as described in the advanced usage section below.
  71.  
  72.    TAME -T command_line
  73.  
  74. Work in the program for a little while, then exit normally.  Upon exit, Tame
  75. will display a summary of its activities.  The displayed totals include the
  76. number of "Desqview pauses" that were performed.  If this number is zero, then
  77. Tame is not needed with the application.  With some extremely keyboard-hungry
  78. programs, the number of Desqview pauses can number into the thousands.
  79.  
  80. A second, and more direct way to test the effectiveness of Tame is to run the
  81. application without Tame, and simultaneously run a CPU benchmark, such as
  82. Norton's System Information (SI) program.  Then use Tame  to run the program
  83. and run the same benchmark.  Be sure the application is idle, and waiting for
  84. keyboard input when you run the benchmark program.  If the benchmark  indicates
  85. that  the CPU is faster with Tame, then you know it is helping.    Also,
  86. experiment with which program is in the foreground and which is in the
  87. background.  This experiment is necessary if you have set the Desqview
  88. background task priority to a very low number.  In any event, it is
  89. informitive, since it indicates the amount of processing time that the
  90. background can get while you are using that application.
  91.  
  92. Running Tame
  93.  
  94. To run Tame, simply type the TAME command, followed by a command line.  For
  95. example, the following command will start up Lotus 123.
  96.  
  97.    TAME LOTUS
  98.  
  99. If you always want Tame to be used, you may create a batch file (possibly named
  100. RUNLOTUS.BAT) as described in the DOS manual.
  101.  
  102. If you normally execute the program with the Desqview "Open Window" menu, you
  103. will need to modify the definition of the window.  To do this, use the "CP"
  104. (for Change Program) option of the "Open Window" menu, and change the Program
  105. to TAME and add what was previously the Program to the beginning of the command
  106. line parameters.
  107.  
  108. If your program runs slower with Tame
  109.  
  110. In some cases, the program may initially run slower with Tame installed.  This
  111. may be corrected by specifying the -Max parameter (described below) to increase
  112. the number of polls allowed before Tame tries to switch tasks.  For example,
  113. the following command line should be used to run Lotus Manuscript.
  114.  
  115.    TAME -MAX:20 MS
  116.  
  117. Using Tame with other multitaskers
  118.  
  119. Tame may be used with multitasking environments other than Desqview, but may
  120. not be quite as effective.  Also, you must include a command line option that
  121. indicates the method that Tame uses to give idle time to the other tasks.  The
  122. -Key method will be effective with programs that are polling the keyboard, and
  123. no other devices.  It may not be compatible with communications programs.  The
  124. -Idle option  is compatible with  most programs, but may not be effective,
  125. depending upon the multi tasking software being used.  In either case, run Tame
  126. as normal, except include one of the options prior to the command.  The
  127. following command will run Lotus 123 in a non-Desqview environment.
  128.  
  129.    TAME -T -K LOTUS
  130.  
  131. Advanced usage
  132.  
  133. Try the TAMEPATH and TAMESMAL versions of the program.  They will use less
  134. memory, but they must run a .EXE or .COM file directly, and the full pathname
  135. of the program file must be specified.  This situation is tolerable when used
  136. in a batch file.
  137.  
  138. Tame is designed to run with DOS shells, as well as normal applications.  If
  139. you use a DOS shell, such as the Norton Commander, that needs tame, you may use
  140. Tame to execute the shell.  By default, Tame will also be in effect for all
  141. programs that are run with the shell.   If you run your editor and other
  142. programs with a batch file that forces Tame to be used, you will normally
  143. invoke a second copy of Tame that may not be needed.  Tame provides an easy
  144. method to prevent you from accidentally running a second copy of Tame when you
  145. are in the shell.  To do this, include the following two lines in your
  146. AUTOEXEC.BAT file.
  147.  
  148.    SET TAME=TAME
  149.    SET TAMEPATH=TAMEPATH
  150.  
  151. If you desire, you may also include any Tame options that are desired. For
  152. example, the following lines will print a totals summary upon exit.
  153.  
  154.    SET TAME=TAME -T
  155.    SET TAMEPATH=TAMEPATH -T
  156.  
  157. Now, in the batch file that invokes your program, use the TAME variable as
  158. follows.  When run from the DOS shell, the command line will be run without
  159. Tame, as long as the DOS shell was invoked using Tame.
  160.  
  161.    %tame% command_line
  162.  
  163. Tame works by detecting when a program is continually polling the keyboard, and
  164. does its best to allow the multi tasking software to switch to another task.
  165. It detects that a program is polling the keyboard after three successive
  166. keyboard polls, without attempting writing to the screen or issuing any DOS
  167. requests.  When the application polls the keyboard a fourth  consecutive time,
  168. Tame tries to switch the task.  This threshold may be  increased or decreased
  169. using the -MAX:nn option, where nn is the threshold.
  170.  
  171. Whenever Tame is running, all programs of that task are affected.  If you use
  172. Tame to run a DOS shell, and you run a program under the DOS shell, then that
  173. program is also tamed.  If this is not desired, then the depth of programs may
  174. be adjusted by using the -CALLS:nn option, where nn is  the number of program
  175. levels Tame has control  over.  This option should be used with care, since
  176. some programs call other .EXE files as a normal part of their execution.
  177.  
  178. Some applications will grab the timer interrupt that the PC will issue 18 times
  179. per second.  In many cases, this interrupt takes a lot of processing time, but
  180. really provides very little utility.  To avoid wasting processing time
  181. servicing the timer interrupt,  you may prevent the application from
  182. controlling the timer interrupt by specifying the -NOTIMER option.  In many
  183. cases, the timer interrupt may be used to keep a clock running on the screen.
  184. This clock may not be worth much to you when you consider the amount of
  185. processing time it uses.  For example, the following command line will run the
  186. Brief editor, (as long as the auto-save feature of Brief is disabled),  and
  187. will gain a significant amount of processor time for background processes.
  188.  
  189.    TAME -NOTIMER B
  190.  
  191. Some applications spend a lot of time polling the system clock, normally for
  192. the purpose of an maintaining an on-screen clock while it is waiting for other
  193. devices to have a character ready.  The -TIME option instructs Tame to treat
  194. the date and time query in a manner similar to the keyboard poll, and yield the
  195. time slice after successive date or time queries.  The following program runs
  196. PCBOARD, which keeps an on-screen clock while waiting for the communications
  197. port.
  198.  
  199.    TAME -TIME PCBOARD
  200.  
  201. Files included
  202.  
  203. TAME.DOC               This document file.
  204.  
  205. TAME.EXE               General purpose Tame program.
  206.  
  207. TAMEPATH.EXE           Works only when you specify full path of .EXE or .COM
  208.                        program.   It uses slightly less memory than TAME.EXE
  209.                        because it does not load another copy of COMMAND.COM.
  210.  
  211. TAMESMAL.EXE           Same as TAMEPATH except it has no text output
  212.                        capabilities,  and therefore uses less memory.
  213.  
  214. SOURCE.ARC             Complete source code is included.  The source is
  215.                        compatible with Microsoft C version 5.1.
  216.  
  217.                              Tame Command Reference
  218.  
  219. Task switching options
  220.  
  221. The main purpose of Tame is to switch to another task when it detects that the
  222. application is wasting time polling the keyboard.  The following options
  223. specifiy the method that Tame should use in order to switch tasks.
  224.  
  225. -DesqView       The -DesqView option specifies that Tame should execute the
  226. -DV             Desqview Pause function to switch tasks.  Since Tame will
  227.                 automatically detect the use of Desqview, this option is not
  228.                 normally required.
  229.  
  230. -Idle           The -Idle option specifies that the idle interrupt is to be
  231. -I              invoked as a method to switch tasks.  This interrupt is
  232.                 designed to be called whenever the application  is idle,  and
  233.                 waiting on a specific device, such as the keyboard.  In fact,
  234.                 all applications that poll the keyboard waiting for input
  235.                 should use this interrupt.  Unfortunately, few do, so Tame will
  236.                 call the interrupt for them.  Some multitasking environments
  237.                 will detect the interrupt call, and switch tasks.  Other
  238.                 environments will ignore the interrupt completely.
  239.                 Note:  The idle interrupt is Interrupt 15h, where ax=9002h.
  240.  
  241. -Key            The -Key option specifies that when the program polls the
  242. -K              keyboard, Tame should tell a white lie and say that a key has
  243.                 been pressed.  Most applications will immediately read the key
  244.                 that Tame claimed was already pressed.  Since it really was not
  245.                 pressed, DOS will wait for a key to be pressed.  Most
  246.                 multitaskers use this wait for a key press as a queue to switch
  247.                 tasks.  The -Key option could be the most effective task
  248.                 switching method in Tame, but it will not work with some
  249.                 applications.  Specifically, the -KEY option will not work with
  250.                 any applications that poll devices other than the keyboard.
  251.  
  252. Fine tuning for an Application
  253.  
  254. -Calls:nn       This option will limit the scope of Tame to nn program levels.
  255.                 For example, if you run a program using tame, and specify Tame
  256.                 effects only one level, programs that are called by the Tamed
  257.                 program will not be affected by Tame.  This is mainly available
  258.                 for useing Tame to run a DOS shell or another program that
  259.                 allows you to execute other DOS commands.
  260.  
  261. -Max:nn         This option sets the number of consecutive keyboard polls that
  262.                 are acceptable before Tame decides that the program is simply
  263.                 polling while waiting for input.
  264.  
  265. -NOTIMER        This option prevents the application from processing the timer
  266.                 interrupt that is normally issued by the PC 18 times per
  267.                 second.  This option may disable some features of the program,
  268.                 and should be used with caution.
  269.  
  270. -TIME           This option instructs Tame to consider a request for the
  271.                 current time to be similar to a keyboard poll.  This works well
  272.                 with programs that constantly update an on-screen clock.  This
  273.                 option has no effect when -KEY is specified.
  274.  
  275. Other options
  276.  
  277. -Poll           This option will cause Tame to allow all keyboard poll requests
  278.                 to really poll the keyboard, effectively disabling the effect
  279.                 of Tame.   This option is really only useful when combined with
  280.                 the -Totals option, so that the number of keyboard calls with
  281.                 and without Tame may be compared.  This comparison is most
  282.                 effective when one or more background tasks are actively
  283.                 running.
  284.  
  285. -Totals         After the program exits, a summary report is displayed.  The
  286.                 summary includes the number of task switches that were
  287.                 initiated by Tame, and also the total number of keyboard calls
  288.                 that the application made.
  289.  
  290.                                  Appendix "A"
  291.  
  292. Recommended Tame parameters for Desqview
  293.  
  294. Most applications may be run with Tame without any special parameters.
  295. However, for best results, certain command line parameters may be desirable for
  296. some applications.  The following table represents the benefits and effects of
  297. recommended command line parameters for each program when run under Desqview.
  298. You are free to add the -Totals option to any of these if a summary report is
  299. desired.  You may also use TAMEPATH or TAMESMAL in place of TAME as long as the
  300. full path name of the program file is specified.
  301.  
  302.  
  303.  Application     Recommended command line   Results & Side effects
  304.  Program
  305.  
  306.  Brief           TAME B                     * 75% of the CPU overhead is
  307.                                                eliminated.
  308.  
  309.  Brief           TAME -NOTIMER B            * Nearly all the CPU overhead is
  310.                                                eliminated.
  311.                                             * On screen clock is not
  312.                                                operational.
  313.                                             * Autosave feature will not
  314.                                                operate
  315.  
  316.  Kedit           TAME KEDIT                 * Nearly all of the CPU overhead
  317.                                                is  eliminated.
  318.  
  319.  Lotus 123       TAME LOTUS                 * Nearly all the CPU overhead is
  320.                                                eliminated.
  321.  
  322.  Lotus Agenda    TAME AGENDA                * Nearly all the CPU overhead is
  323.                                                eliminated.
  324.  
  325.  Lotus           TAME -MAX:20 MS            * Nearly all the CPU overhead is
  326.  Manuscript                                    eliminated.
  327.  
  328.  Lucid 3D        TAME LUCID                 * Nearly all the CPU overhead is
  329.                                                eliminated.
  330.  
  331.  Microsoft       TAME M                     * Nearly all the CPU overhead is
  332.  Editor                                        eliminated.
  333.  
  334.  Norton          TAME NCSMALL               * Nearly all the CPU overhead is
  335.  Commander                                     eliminated.
  336.                                             * Tame will also cover programs
  337.                                                that are run by the shell.
  338.  
  339.  PCBOARD         TAME -TIME PCBOARD         * About half of the CPU overhead
  340.                                                is eliminated.
  341.  
  342.  Sidetalk        TAME ST /N                 * 75% of the CPU overhead is
  343.                                                eliminated.
  344.                                             * Do not use tame without the /N
  345.                                                parameter.
  346.  
  347.  ZCOMM           TAME ZCOMM                 * About 75% of the CPU overhead
  348.                                                is eliminated.
  349.  
  350.